package com.semp.gu.ui.session;

import java.util.List;


public class SessionManager {

	// Injection
	private List<SessionActionListener> actionListenerList;
	private List<SessionActionProducer> actionProducerList;


	public void contentUpdated(SessionAction action) {
		for (SessionActionListener listener : actionListenerList) {
			listener.onContentChanged(action);
		}
	}
	
	// Getters & setters
	public List<SessionActionListener> getActionListenerList() {
		return actionListenerList;
	}


	public void setActionListenerList(List<SessionActionListener> actionListenerList) {
		this.actionListenerList = actionListenerList;
	}

	public List<SessionActionProducer> getActionProducerList() {
		return actionProducerList;
	}

	public void setActionProducerList(List<SessionActionProducer> actionProducerList) {
		this.actionProducerList = actionProducerList;
		// Auto registration
		for (SessionActionProducer producer : actionProducerList) {
			producer.registerSessionManager(this);
		}
	}
	

}
